// import { HexagonJenga_GameStorage } from './HexagonJenga_GameStorage';

import { HexagonJenga_GameStorage } from "./HexagonJenga_GameStorage";

export class HexagonJenga_GameData {
    // mode_1休闲模式 mode_2计时模式
    static Game_mode: string = `mode_1`;
    static 是否结束: boolean = false;

    static item_撤回_number: number = 10;
    static item_加瓶子_number: number = 10;

    static item_撤回_add_number: number = 10;
    static item_加瓶子_add_number: number = 10;

    static InitData() {
        HexagonJenga_GameData.是否结束 = false;
    }

    // 关卡从1开始
    static Get_level() {
        if (HexagonJenga_GameData.Game_mode === `mode_1`) {
            return HexagonJenga_GameStorage.data.mode_1.level;
        }
        else if (HexagonJenga_GameData.Game_mode === `mode_2`) {
            return HexagonJenga_GameStorage.data.mode_2.level;
        }

        return HexagonJenga_GameStorage.data.mode_1.level;
    }

    static Set_level(_level) {
        if (HexagonJenga_GameData.Game_mode === `mode_1`) {
            HexagonJenga_GameStorage.data.mode_1.level = _level;
        }
        else if (HexagonJenga_GameData.Game_mode === `mode_2`) {
            HexagonJenga_GameStorage.data.mode_2.level = _level;
        }

        HexagonJenga_GameStorage.saveData();

        // HexagonJenga_GameStorage.data.mode_1.level = _level;
        // HexagonJenga_GameStorage.saveData();
    }

    static Get_item_加瓶子_number() {
        if (HexagonJenga_GameData.Game_mode === `mode_1`) {
            return HexagonJenga_GameStorage.data.mode_1.item_道具1_number;
        }
        else if (HexagonJenga_GameData.Game_mode === `mode_2`) {
            return HexagonJenga_GameStorage.data.mode_2.item_道具1_number;
        }

        return HexagonJenga_GameStorage.data.mode_1.item_道具1_number;
    }

    static Set_item_加瓶子_number(_number) {
        if (HexagonJenga_GameData.Game_mode === `mode_1`) {
            // HexagonJenga_GameStorage.data.mode_1.item_加瓶子_number = _number;
        }
        else if (HexagonJenga_GameData.Game_mode === `mode_2`) {
            // HexagonJenga_GameStorage.data.mode_2.item_加瓶子_number = _number;
        }

        HexagonJenga_GameStorage.saveData();
    }
}

window["HexagonJenga_GameData"] = HexagonJenga_GameData;